<?php
/*MMCaller it's a class with routine to call the code from another modules, 
making sure that the code, the module exist before call it. To be used inside modules.
*/
class Modules_Common_MMCaller
{
	var $keep_historic=null;
	public function __construct($class, $arguments)
	{
		getObject($class,$arguments);
	}
	public function Exist($class)
	{
		return class_exists  ( $class );
	}
	public function getObject($class,$arguments)
	{
		if(!$this->Exist($class))
			return null;
		$this->keep_historic=new $class($arguments);
	}
	
 	public function __call($name, $arguments) {
		if($keep_historic==null)
			return null;
		if(method_exists($keep_historic,$name))
 			$keep_historic->$name(arguments);
    	else
    		return null;
 	}
}
?>